package com.zx.mobile.filter;

import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

public class MobileRequestWrapper extends HttpServletRequestWrapper{

    private static final String SESSIONID = "sessionId";

    //记录session信息
	private String sessionInfo;
	public MobileRequestWrapper(HttpServletRequest request,String value) {
		super(request);
		this.sessionInfo = value;
	}
	
	@Override
    public String getParameter(String name) {
		String value = super.getParameter(name);
        if(StringUtils.isBlank(value) && SESSIONID.equals(name)){//包含改参数 均返回正常信息  此处需注意是否存在情况session、情况
             value = this.sessionInfo;
        }
        return value;
    }
}
